-- GENERATED SPELL FOR [Sunhawk Defender] --


function spell0_17607(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17607', 522, 1)
end

function spell1_17607(pUnit, Event) --@Mark of the Sunhawk,n/a--
pUnit:FullCastSpellOnTarget(31734,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17607', 20275, 1)
end

function spell2_17607(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(31738,pUnit)
pUnit:RegisterEvent('Sorts_17607', 604, 1)
end

function spell3_17607(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(31737,pUnit)
pUnit:RegisterEvent('Sorts_17607', 2000, 1)
end

function Sorts_17607(pUnit, Event)
local choix_sorts_17607 = math.random(0, 3)
if choix_sorts_17607 == 0 then
pUnit:RegisterEvent('spell0_17607', 1, 1)
end
if choix_sorts_17607 == 1 then
pUnit:RegisterEvent('spell1_17607', 1, 1)
end
if choix_sorts_17607 == 2 then
pUnit:RegisterEvent('spell2_17607', 1, 1)
end
if choix_sorts_17607 == 3 then
pUnit:RegisterEvent('spell3_17607', 1, 1)
end
end

function mob17607_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17607', math.random(1500, 3000), 1)
end

function mob17607_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17607_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17607_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17607, 1, 'mob17607_Action')
RegisterUnitEvent(17607, 2, 'mob17607_Leave')
RegisterUnitEvent(17607, 3, 'mob17607_Kill')
RegisterUnitEvent(17607, 4, 'mob17607_Die')
